package com.huanf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huanf.mapper.DataMapper;
import com.huanf.pojo.JdData;
import com.huanf.service.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author: 35238
 * 功能:
 * 时间: 2023-11-12 23:12
 */
@Service
public class DataServiceImpl extends ServiceImpl<DataMapper, JdData> implements DataService {

    @Autowired
    //DataDao是我们写的接口
    private DataMapper dataMapper;

    @Override
    @Transactional
    //重写DataService接口的xxsave方法
    public void xxsave(JdData jdData) {
        dataMapper.insert(jdData);
    }

    @Override
    //重写DataService接口的xxfindAll方法
    public List<JdData> xxfindAll(JdData jdData) {
        List<JdData> list = dataMapper.selectList(new QueryWrapper<>(jdData));
        return list;
    }
}
